package messages;

import game.Player;

import java.util.List;


/**
 * ListPlayersReplyMessage
 *
 * Message sent by the server with the list of online players.
 */
public class ListPlayersReplyMessage extends Message {

	public ListPlayersReplyMessage(List<Player> players) {
		super();
		
		this.players = players;
	}

	
	/**
	 * Returns the list of online players.
	 * 
	 * @return The list of online players.
	 */
	public List<Player> getPlayers() {
		return this.players;
	}

	
	public String toString() {
		String s = super.toString() + " ListPlayersReply ";
		
		for (Player player : players) {
			s += "[" + player.getLogin() + " - " + player.getRanking() + "] ";
		}
		
		return s;
	}
	
	
	private List<Player> players;	// List of online players.

	private static final long serialVersionUID = 1L;	
}
